﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace TinyCinema.UI.Pages.Schedule._Deal._NewDeal
{
    /// <summary>
    /// Interaction logic for SelectDesk.xaml
    /// </summary>
    public partial class SelectDesk : Page
    {
        public SelectDesk()
        {
            InitializeComponent();
            (DataContext as Bussiness.Schedule.Schedule).Messenger.Register<Bussiness.Schedule.Message.ScheduleOrderedSelecting>(this, ShowMessageBox1);
            (DataContext as Bussiness.Schedule.Schedule).Messenger.Register<Bussiness.Schedule.Message.ScheduleOrderingNotValid>(this, ShowMessageBox2);
            (DataContext as Bussiness.Schedule.Schedule).Messenger.Register<Bussiness.Schedule.Message.NoDeskSelected>(this, ShowMessageBox3);
            (DataContext as Bussiness.Schedule.Schedule).Messenger.Register<Bussiness.Schedule.Message.CheckOut>(this, ShowMessageBox4);


        }
        void ShowMessageBox1(Bussiness.Schedule.Message.ScheduleOrderedSelecting s)
        {
            MessageBoxUtils.WPFMessageBox.Show((App.Current.FindResource("langMsgScheduleOrderedSelecting") as String), "", MessageBoxButton.OK);
        }
        void ShowMessageBox2(Bussiness.Schedule.Message.ScheduleOrderingNotValid s)
        {
            MessageBoxUtils.WPFMessageBox.Show((App.Current.FindResource("langMsgScheduleOrderingNotValid") as String), "", MessageBoxButton.OK);
        }
        void ShowMessageBox3(Bussiness.Schedule.Message.NoDeskSelected s)
        {
            MessageBoxUtils.WPFMessageBox.Show((App.Current.FindResource("langMsgScheduleNoDeskSelected") as String), "", MessageBoxButton.OK);
        }
        void ShowMessageBox4(Bussiness.Schedule.Message.CheckOut s)
        {
            Deal.pagNewDeal.pagContentFrameSource = NewDeal.pagCheckOut;
        }
        private void Back(object sender, RoutedEventArgs e)
        {
            Deal.pagNewDeal.pagContentFrameSource = NewDeal.pagSelectSchedule;
        }
    }
}
